-
Notifications
You must be signed in to change notification settings - Fork 3.4k
chore: use cloud validations for packages/server api request/response types #32632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
cypress
|
Project |
cypress
|
Branch Review |
chore/use-api-typedefs
|
Run status |
|
Run duration | 43m 47s |
Commit |
|
Committer | Cacie Prins |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
15
|
|
1102
|
|
4
|
|
26706
|
View all changes introduced in this branch ↗︎ |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
45.27%
|
|
---|---|
|
186
|
|
158
|
Accessibility
97.99%
|
|
---|---|
|
4 critical
8 serious
2 moderate
2 minor
|
|
100
|
Tests for review
cypress/e2e/studio/studio.cy.ts • 1 failed test • app-e2e
Test | Artifacts | |
---|---|---|
Cypress Studio > updates an existing test with assertions |
Test Replay
Screenshots
|
e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary |
Test Replay
|
issues/28527.cy.ts • 1 flaky test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
issue 28527 > fails and then retries and verifies about:blank is not displayed |
Test Replay
Screenshots
|
commands/window.cy.js • 1 flaky test • 5x-driver-firefox
Test | Artifacts | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
... > only logs once |
|
Test | Artifacts | |||||||
---|---|---|---|---|---|---|---|---|
src/cy/commands/files > #readFile > retries to read when ENOENT |
|
Test | Artifacts | |
---|---|---|
issue 28527 > fails and then retries and verifies about:blank is not displayed |
Screenshots
|
The first 5 flaky specs are shown, see all 13 specs in Cypress Cloud.
return cb(response) | ||
} catch (err: unknown) { | ||
onError(err) | ||
debug('postInstanceTests failed, allowing browser to hang until it is killed: Error %o', { err }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Error Handling Fails to Return Early After API Failure
The refactored error handling for _postInstanceTests
in onTestsReceived
is missing an explicit return
statement in its catch
block. This causes the function to continue executing after an API failure instead of returning early, which alters the intended behavior of letting the browser hang.
.catch((err: any) => { | ||
onError(err) | ||
|
||
return responseDidFail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we no longer need this logic?
"dev": "node index.js", | ||
"docker": "cd ../.. && WORKING_DIR=/packages/server ./scripts/run-docker-local.sh", | ||
"postinstall": "patch-package", | ||
"postinstall": "patch-package && yarn sync-cloud-validations", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are doing this at the package level, do we still need to call it in CI after the build? Would be nice to get rid of this https://github.com/cypress-io/cypress/blob/develop/.circleci/src/pipeline/@pipeline.yml#L201
Additional details
System tests currently fetch typescript definitions and example payloads for API endpoints when they run. This ensures our api calls are supported properly by the server.
This adds the same functionality to packages/server, so we can make sure our api functions use up-to-date typedefs from Cypress Cloud
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?Note
Adopts Cloud-provided validation types for server API requests/responses, adds a sync script and build hooks, and refactors record flow error handling with stricter typings.
lib/cloud/api/index.ts
andlib/cloud/api/create_instance.ts
(e.g.,PostRun*
,PostRunInstance*
,PostInstanceResults*
).ping
,getAuthUrls
,createInstance
,postInstanceTests
,updateInstanceStdout
,updateInstanceArtifacts
,postInstanceResults
, etc.).options.testingType
and add localPutInstanceArtifactsResponseType
alias._postInstanceTests
inlib/modes/record.ts
to async/await with try/catch usingcloudCannotProceedErr
.onTestsReceived
to handle failures via try/catch and skip logic; emitproject.emit('end', { skippedSpec: true })
on skip.scripts/sync-cloud-validations.sh
and npm scriptssync-cloud-validations
,ensure-cloud-validations
; run duringpostinstall
and before TypeScript (build-prod
,check-ts
).zod
and ignore generatedlib/validations
in.gitignore
.Written by Cursor Bugbot for commit d7e2dd8. This will update automatically on new commits. Configure here.